import { RouteRecordRaw } from 'vue-router'

export const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        name: "main",
        component: () => import("../views/Main.vue"),
        children: [
            {
                path:'/home',
                name:"home",
                alias:'',
                component:()=>import("../views/Home.vue"),
                meta: {
                    keepAlive: true // 添加 meta 字段，标记需要缓存的组件
                  },
                children:[
                    {
                        path:'/recommendation',
                        name:"recommendation",
                        alias:'',
                        component:()=>import("../views/Recommendation.vue"),

                    },
                    {
                        path:'/follow',
                        name:"follow",
                        component:()=>import("../views/Follow.vue"),
                    },
                    {
                        path:'/note',
                        name:"note",
                        component:()=>import("../views/Note.vue"),
                    },
                    {
                        path:'/video',
                        name:"video",
                        component:()=>import("../views/Video.vue"),
                    },
                    {
                        path:'/activity',
                        name:"activity",
                        component:()=>import("../views/Activity.vue"),
                    },
                ]
            },
            {
                path: '/classlist',
                name: "classlist",
                component: () => import("../views/ClassList.vue")
            },
            {
                path: '/my',
                name: "my",
                component: () => import("../views/My.vue"),
            },
            {
                path: '/collect',
                name: "collect",
                component: () => import("../views/Collect.vue"),
            }
        ]
    },
    {
        path:'/userdetails/:id/:path',
        name:"userdetails",
        component:()=>import("../views/User_details.vue"),
    },
    {
        path: '/search',
        name: "search",
        component: () => import("../views/Search.vue")
    },
    {
        path: '/recipes',
        name: "recipes",
        component: () => import("../views/Recipes.vue")
    },
    {
        path: '/Notebook2/:id/:path',
        name: "Notebook2",
        component: () => import("../views/Notebook2.vue")
    },
    {
        path:'/menuDetail/:menuId/:path',
        name:'MenuDetail',
        component: () => import('../views/MenuDetail.vue')
    },
]